<!--登录界面-->
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!-- 导入头部top文件 start -->
<%@include file="common/header.jsp" %>
<body>
<div class="login col-xs-12 col-sm-12 col-md-12">
    <div class="login-div-top">
        <form class="form-horizontal" id="mainForm" method="post" action="/login">
            <div class="form-group">
                <label class="col-sm-2 control-label"><span class="star">*</span>用户名：</label>
                <div class="col-sm-10">
                    <input type="text" class="form-control" id="username" placeholder="请输入用户名" name="username">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label"><span class="star">*</span>密码：</label>
                <div class="col-sm-10">
                    <input type="password" class="form-control" id="password" placeholder="请输入密码" name="password">
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-offset-2 col-sm-10">
                    <button type="submit" class="btn btn-default login-btn">登录</button>
                    <button type="button" class="btn btn-default login-btn" onclick="window.location.href='register'">注册</button>
                </div>
            </div>
        </form>
    </div>
</div>
<script src="${path}/static/js/jquery.min.js?v=2.1.4"></script>
<script src="../static/js/bootstrap.min.js?v=3.3.5"></script>
<script src="../static/js/plugins/validate/jquery.validate.min.js"></script>
<script src="../static/js/plugins/validate/messages_zh.min.js"></script>
<script>
    $().ready(function() {
// 在键盘按下并释放及提交后验证提交表单
        $("#mainForm").validate({
            rules: {
                username: {
                    required: true,
                    minlength: 2
                },
                password: {
                    required: true,
                    minlength: 1
                }
            },
            messages: {
                username: {
                    required: "请输入用户名",
                    minlength: "用户名必需由两个字母组成"
                },
                password: {
                    required: "请输入密码",
                    minlength: "密码长度不能小于 1 个字母"
                }
            }
        })
    });
</script>
</body>
</html>